﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gfw.Infrastructure.Facilities;
using Gfw.Repository;

namespace GameSettlement
{
    public class SettlementCenter
    {
        /// <summary>
        /// 对碰奖结算
        /// </summary>
        public static void PairAward()
        {
            UnitOfWork work = new UnitOfWork();
            Gfw.Infrastructure.Facilities.PairAward pa = new Gfw.Infrastructure.Facilities.PairAward(DateTime.Now.AddMinutes(-5));
            pa.Execute(work);
        }


        /// <summary>
        /// 帐户结算
        /// </summary>
        public static void CompanyAccount()
        {
            AccountSettlement acc = new AccountSettlement(DateTime.Now.AddMinutes(-5));
            acc.Execute();
        }


        /// <summary>
        /// 担保超期返还卖家
        /// </summary>
        public static void WarrantReturn()
        {
            WarrantSettlement warrant = new WarrantSettlement();
            warrant.Execute();
        }


        /// <summary>
        /// 公司总利润统计
        /// <para>只能统计前一天未统计的记录</para>
        /// <para>可以修改系统时间来统计未统计的记录</para>
        /// </summary>
        public static void CompanyProfitStatistics()
        {
            ProfitStatisticsSettlement profit = new ProfitStatisticsSettlement(DateTime.Today.AddDays(-1)); // 只统计前一天，判断有没有当天的记录
            profit.Execute();
        }
    }
}
